<?php
/*
 * 来路分析相关
 * copyright:living10
 */
 class OriginAnalysis extends CI_Controller{
	public function __construct(){
		parent::__construct();
		$this->load->model('OriginAnalysis_model');
		$this->load->helper('date');
		$this->load->helper('url');
	}

	//查询来路
	public function showbyrefer()
	{
		$header['title'] = '来路分析';
		$header['location1'] = '来路分析';
		$header['location2'] = '来路页面';
		$search_day = intval($this->input->get("search_day")?$this->input->get("search_day"):0);
		$search_sdate = htmlspecialchars($this->input->post("search_sdate")?$this->input->post("search_sdate"):date('Y-m-d',strtotime("-".$search_day." day")));
		$search_edate = htmlspecialchars($this->input->post("search_edate")?$this->input->post("search_edate"):date('Y-m-d'));
		$data['search_day'] = $search_day;
		$data['search_sdate'] = $search_sdate;
		$data['search_edate'] = $search_edate;
		$data['data'] = $this->OriginAnalysis_model->showrefer($search_sdate,$search_edate);
 		$this->load->view('main/header',$header);
 		$this->load->view('main/Origin_analysis/showbyrefer',$data);
 		$this->load->view('main/footer');
	}

	//来路域名
	public function showbydomain()
	{
		$header['title'] = '来路分析';
		$header['location1'] = '来路分析';
		$header['location2'] = '来路域名';
		$search_day = intval($this->input->get("search_day")?$this->input->get("search_day"):0);
		$search_sdate = htmlspecialchars($this->input->post("search_sdate")?$this->input->post("search_sdate"):date('Y-m-d',strtotime("-".$search_day." day")));
		$search_edate = htmlspecialchars($this->input->post("search_edate")?$this->input->post("search_edate"):date('Y-m-d'));

		$data = $this->OriginAnalysis_model->showDomain($search_sdate,$search_edate);
		$data['search_day'] = $search_day;
		$data['search_sdate'] = $search_sdate;
		$data['search_edate'] = $search_edate;
 		$this->load->view('main/header',$header);
 		$this->load->view('main/Origin_analysis/showbydomain',$data);
 		$this->load->view('main/footer');
	}
 }
?>
